package com.xiaor.rssmodel.model;

import com.xiaor.rssmodel.model.common.Common;
import io.swagger.annotations.ApiModel;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.persistence.*;

/**
 * 党的重大会议
 */
@Entity
@Table(name = "meeting")
@Data   //生成Getter和Setter
@NoArgsConstructor  //生成无参构造函数
@AllArgsConstructor //生成有参构造函数
@ApiModel("Meeting--会议的实体类")   //用于Swagger展示
public class Meeting extends Common {
    @OneToOne
    @JoinTable(name = "event_meeting",
            joinColumns = {@JoinColumn(name = "mid")},
            inverseJoinColumns = {@JoinColumn(name = "eid")}
    )
    private Event event;

    @Override
    public String toString() {
        return "Meeting{" +
                "event=" + event +
                '}';
    }
}
